From: Eneas U de Queiroz Date: Fri, 14 Dec 2018 17:13:41 +0000 (-0200) Subject: mrib.c: don't use cpu_to_be32 outside of function X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22/%22https:/collectd.org/%22?a=commitdiff_plain;h=722151f04348cf1b759613c087bced52fb45790a;p=project%2Fomcproxy.git mrib.c: don't use cpu_to_be32 outside of function cpu_to_be32 is not a constant, so it can't be used outside of a function. Signed-off-by: Eneas U de Queiroz --- diff --git a/src/mrib.c b/src/mrib.c index 476768b..bdb4493 100644 --- a/src/mrib.c +++ b/src/mrib.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -54,7 +55,13 @@ struct mrib_iface { struct uloop_timeout timer; }; -static uint32_t ipv4_rtr_alert = cpu_to_be32(0x94040000); +/* we can't use cpu_to_be32 outside a function */ +#if __BYTE_ORDER == __BIG_ENDIAN +static uint32_t ipv4_rtr_alert = 0x94040000; +#else +static uint32_t ipv4_rtr_alert = 0x00000494; +#endif + static struct { struct ip6_hbh hdr; struct ip6_opt_router rt;